<!DOCTYPE HTML>
<html lang="pt-br" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<h:head>
	
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<meta name="description" content=""/>
	<meta name="author" content=""/>
	 
	<link rel="icon" type="image/png" href="#{facesContext.externalContext.request.contextPath}/lib/imagem/logomarca.png"/>
	
	<link href="#{facesContext.externalContext.request.contextPath}/lib/css/bootstrap.min.css" rel="stylesheet" media="screen"/>
	<link href="#{facesContext.externalContext.request.contextPath}/lib/css/bootstrap-theme.min.css" rel="stylesheet" media="screen"/>
	<link href="#{facesContext.externalContext.request.contextPath}/lib/css/venda.css" rel="stylesheet" media="screen"/>
	<link href="#{facesContext.externalContext.request.contextPath}/lib/css/picklist.css" rel="stylesheet" media="screen"/>
	
	<title>Dallas Moto Peças - Venda</title>
	<script type="text/javascript">     
		PrimeFaces.locales['pt'] = {  
			closeText: 'Fechar',  
			prevText: 'Anterior',  
			nextText: 'Próximo',  
			currentText: 'Começo',  
			monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],  
			monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', 'Jul','Ago','Set','Out','Nov','Dez'],  
			dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado'],  
			dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],  
			dayNamesMin: ['D','S','T','Q','Q','S','S'],  
			weekHeader: 'Semana',  
			firstDay: 0,  
			isRTL: false,  
			showMonthAfterYear: false,  
			yearSuffix: '',  
			timeOnlyTitle: 'Só Horas',  
			timeText: 'Tempo',  
			hourText: 'Hora',  
			minuteText: 'Minuto',  
			secondText: 'Segundo',  
			ampm: false,  
			month: 'Mês',  
			week: 'Semana',  
			day: 'Dia',  
			allDayText : 'Todo o Dia'  
		};
		 var chartStyle = {  
	             padding:20,  
	             legend: {  
	                 display:"right",  
	                 spacing:10  
	             }  
	         };
		 function desabilitarEnter() 
			{
				var tecla = event.keyCode;
				if (tecla == 13){
					return false;
				}
				return true;
			}
	</script>
	
	<style type="text/css">
     	.ui-layout-north 
     	{
        	z-index:20 !important;
            	overflow:visible !important;;
		}
		.ui-layout-north .ui-layout-unit-content {
        	overflow:visible !important;
       	} 	
		.colunaEsquerda
		{  
		    text-align: left;
		    width: 20%;  
		}  
		.colunaDireita
		{  
		    text-align: left;
		    width: 80%    
		}
	</style>
		
	</h:head>
	
	<h:body>
	
	<p:ajaxStatus onstart="PF('statusDialog').show();" 
				onsuccess="PF('statusDialog').hide();"/>
	
	<p:dialog modal="true" 
			widgetVar="statusDialog" 
			header="Aguarde"
			resizable="false"   
    		draggable="false" 
    		closable="false">  
    	<p:graphicImage value="/lib/imagem/gif-load.gif" /> 
	</p:dialog>
	

	
	<h:form id="frmVenda" onkeypress="return desabilitarEnter();">
	
	
	<p:dialog header="Sistema Bloqueio" 
    		widgetVar="bloqueioDialog" 
    		modal="true" 
    		showEffect="fade" 
    		hideEffect="fade" 
    		resizable="false" 
    		width="450" 
    		position="center" 
    		closable="false">
    	<p:growl id="mensagem" showDetail="true" autoUpdate="true" closable="true" />	
    	 <p:panel id="bloqueioPanel" 
    	 		style="font-size:12px;">
    	 		
			<p:panelGrid columns="2" 
						columnClasses="colunaEsquerda, colunaDireita" 
						style="width:100%;border:none;">
				
				<p:outputLabel value="Login" for="otxtUsuarioLogado"/>
				<h:outputText id="otxtUsuarioLogado" value="#{usuarioLogado.login}"/>
				
				<p:outputLabel value="Senha" for="itxtSenha"/>
				<p:inputText id="itxtSenha"
							type="password"
							value="#{vendaManagerBean.usuarioTelaBloqueio.senha}"
							style="width:100%"/>
				
			</p:panelGrid>
			
				<div>
				<BR />
				</div>
				
			<p:commandButton id="btnLogar" 
							value="Logar"
							styleClass="ui-priority-primary"
							update="mensagem"
							actionListener="#{vendaManagerBean.desbloquerSistema}"/>
		</p:panel>		
	</p:dialog>
	<p:layout fullPage="true">
	
		<p:layoutUnit position="north" resizable="false" closable="false" collapsible="false" styleClass="titulo">
			 <h:outputText value="Módulo Vendas"/>
		</p:layoutUnit>
		
		<p:layoutUnit position="west" size="180" resizable="false" closable="false" collapsible="false" minSize="100" header="Menu Vendas">
			<p:accordionPanel activeIndex="0">
				<p:tab title="Agenda">
				
					<p:commandLink value="Atender"
								action="#{vendaManagerBean.processaMenuVenda(1)}"/>
					<br/>
					
					<p:commandLink value="Gerenciar"
								action="#{vendaManagerBean.processaMenuVenda(2)}"/>
								
					<br/>
					
					<p:commandLink value="Listar"
								action="#{vendaManagerBean.processaMenuVenda(3)}"/>
					
				</p:tab>
				
				<p:tab title="Clientes">
					<p:commandLink value="Gerenciar"
								action="#{vendaManagerBean.processaMenuVenda(4)}"/>
				</p:tab>
				
				<p:tab title="Promoções">
					<p:commandLink value="Gerenciar"
								action="#{vendaManagerBean.processaMenuVenda(6)}"/>
				</p:tab>
				
				<p:tab title="Agenda Status">
					<p:commandLink value="Gerenciar"
								disabled="#{!vendaManagerBean.vd4}"
								action="#{vendaManagerBean.processaMenuVenda(7)}"/>
				</p:tab>
				
				<p:tab title="Agenda Lembrar">
					<p:commandLink value="Gerenciar"
								disabled="#{!vendaManagerBean.vd5}"
								action="#{vendaManagerBean.processaMenuVenda(8)}"/>
				</p:tab>
				
				<p:tab title="Configuração">
					<p:commandLink value="Curva Abc"
								disabled="#{!vendaManagerBean.vd2}"
								action="#{vendaManagerBean.processaMenuVenda(5)}"/>
				</p:tab>
				
			</p:accordionPanel>
			
			<br/>
			
			<div align="center">
			<p:commandButton value="Sair do Módulo" 
		        			styleClass="ui-priority-primary"
		        			action="#{vendaManagerBean.processaMenuVenda(10)}"/>
		        			
		    <br/>
		    <br/>
		    
		    <p:commandButton value="Bloquear a Tela" 
		        			styleClass="ui-priority-primary"
		        			action="#{vendaManagerBean.processaMenuVenda(11)}"/>
		    </div>
		</p:layoutUnit>
		
		<p:layoutUnit id="lyCenter" position="center"> 
           	<ui:insert name="corpo"/>      
    	</p:layoutUnit>
    	
    	<p:layoutUnit position="south" resizable="false" closable="false" collapsible="false" styleClass="rodape">
			Usuário Logado: <h:outputText value="#{usuarioLogado.nomeCompleto}"/>
		</p:layoutUnit>
    	  
	</p:layout>
	
	<ui:insert name="modal"/>
	
	</h:form>  
	</h:body>
</html>